package com.fank.current.queue.block;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

/**
 * 数组队列一旦初始化好之后就没有办法改变大小
 * @author Fanxk
 * @Date 2018年10月5日
 * @Version 1.0
 */
public class BlockingQueueExample
{
	public static void main(String[] args) throws InterruptedException
	{
		//初始化大小
		BlockingQueue queue = new ArrayBlockingQueue(1024);
		Producer producer = new Producer(queue);
		Consumer consumer = new Consumer(queue);
		new Thread(consumer).start();
		new Thread(producer).start();
		
		Thread.sleep(1000);
		
	}
}
